package br.usp.ime.origami.primitives;


public class NumberPrimitives
{

	public static final double ROUND_VALUE = Math.pow(10, -4);

	public static boolean isZero(double d)
	{
		return d < NumberPrimitives.ROUND_VALUE && d > -NumberPrimitives.ROUND_VALUE;
	}

	public static boolean equals(double d1, double d2)
	{
		return isZero(d1 - d2);
	}

	public static boolean isPositive(double d)
	{
		return d >= -NumberPrimitives.ROUND_VALUE;
	}

	public static boolean isZero(double d, double e)
	{
		return d < e && d > -e;
	}
}
